<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    /* 
      https://leetcode-cn.com/problems/jump-game/
      思路：https://leetcode-cn.com/problems/jump-game/solution/pythonjs-tan-xin-55-tiao-yue-you-xi-by-fe-lucifer/
    */
    var canJump = function(nums) {
      let max = 0;

      for (let i = 0; i < nums.length; i++) {
        if (max < i) return false;
        max = Math.max(i + nums[i], max);
      }

      return max >= nums.length-1;
    };
  </script>
</body>
</html>